package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.InventoryMapper;
import com.ly.heart.service.IInventoryService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.InventoryEntity;

import javax.annotation.Resource;

/**
 * 仓库库存Service业务层处理
 * 
 * @author wutao
 * @date 2024-06-02
 */
@Service
public class InventoryServiceImpl extends ServiceImpl<InventoryMapper,InventoryEntity> implements IInventoryService {

    @Resource
    private InventoryMapper inventoryEntityMapper;

    /**
     * 查询仓库库存
     * 
     * @param id 仓库库存ID
     * @return 仓库库存
     */
    @Override
    public InventoryEntity selectInventoryEntityById(String id)
    {
        return inventoryEntityMapper.selectInventoryEntityById(id);
    }

    /**
     * 查询仓库库存列表
     * 
     * @param inventoryEntity 仓库库存
     * @return 仓库库存
     */
    @Override
    public List<InventoryEntity> selectInventoryEntityList(InventoryEntity inventoryEntity)
    {
        return inventoryEntityMapper.selectInventoryEntityList(inventoryEntity);
    }

    /**
     * 新增仓库库存
     * 
     * @param inventoryEntity 仓库库存
     * @return 结果
     */
    @Override
    public int insertInventoryEntity(InventoryEntity inventoryEntity)
    {
        inventoryEntity.setCreateTime(DateUtils.getNowDate());
        return inventoryEntityMapper.insertInventoryEntity(inventoryEntity);
    }

    /**
     * 修改仓库库存
     * 
     * @param inventoryEntity 仓库库存
     * @return 结果
     */
    @Override
    public int updateInventoryEntity(InventoryEntity inventoryEntity)
    {
        inventoryEntity.setUpdateTime(DateUtils.getNowDate());
        return inventoryEntityMapper.updateInventoryEntity(inventoryEntity);
    }

    /**
     * 批量删除仓库库存
     * 
     * @param ids 需要删除的仓库库存ID
     * @return 结果
     */
    @Override
    public int deleteInventoryEntityByIds(String[] ids)
    {
        return inventoryEntityMapper.deleteInventoryEntityByIds(ids);
    }

    /**
     * 删除仓库库存信息
     * 
     * @param id 仓库库存ID
     * @return 结果
     */
    @Override
    public int deleteInventoryEntityById(String id)
    {
        return inventoryEntityMapper.deleteInventoryEntityById(id);
    }
}
